<?php
/**
 *
 * @purpose: 对“通知”类型中子类型为2(推它被系统删除)的编码与解码文件
 * @author: Mandel Woo <wuzhijian@snda.com>
 */
require_once(dirname(__FILE__)."/../../../models/user/UCModUserInfo.php");


function msg_notice_type2_encoder() {
	$fields = array("rm_time");

	foreach($fields as $k => $v) {
		eval("\${$v}=func_get_arg($k);");
	}

	return serialize(array(
			"rm_time" => $rm_time,
			));
}

function msg_notice_type2_decoder() {
	#这里不改动, begins
	$fields = array("id","receiverid","content","createTime","changeFlag","fmt");
	foreach($fields as $k => $v) {
		eval("\${$v}=func_get_arg($k);");
	}
	#这里不改动, ends

	#将encoder函数返回值解出来，即得到data[key1],data[key2],...
	$data     = unserialize($content);

	#业务逻辑
	$rm_time  = $data['rm_time'];



	if ($fmt == 'line') {
		return sprintf("您于%s发表的推他已被系统管理员删除。", date("Y年m月d日H:i", $rm_time));

	} else if ($fmt == 'box') {
		$html = sprintf("您于%s发表的推他已被系统管理员删除。", date("Y年m月d日H:i", $rm_time));
		return '<div class="font14">' . $html . '</div>';

	} else {
		return '';
	}
}


